package cn.sirun.com.fca.account.loader;

import com.tencent.cloud.iov.kernel.model.BaseResponse;

import cn.sirun.com.fca.account.model.login.LoginResponse;
import cn.sirun.com.fca.account.repo.register.RegisterRepository;
import cn.sirun.com.fca.account.repo.reset.ResetRepository;
import io.reactivex.Observable;
import io.reactivex.schedulers.Schedulers;

public class PasswordLoader extends AccountFlowLoader {

    public Observable<BaseResponse<LoginResponse>> setPassword(String password) {
        return RegisterRepository.getInstance().setPassword(password)
                .subscribeOn(Schedulers.io());
    }

    public Observable<BaseResponse<LoginResponse>> setEmailPassword(String password) {
        return RegisterRepository.getInstance().setEmailPassword(password)
                .subscribeOn(Schedulers.io());
    }

    public Observable<BaseResponse<Void>> resetSetPassword(String password) {
        return ResetRepository.getInstance().setPassword(password)
                .subscribeOn(Schedulers.io());
    }

    public Observable<BaseResponse<Void>> resetSetEmailPassword(String password) {
        return ResetRepository.getInstance().setEmailPassword(password)
                .subscribeOn(Schedulers.io());
    }
}
